import {
	req1,
	req3
} from '@/http/http.js'
import {
	url1
} from './common.js'
//  req1 正常 请求 req3 携带token 请求
// 上传  视频
// demo-dev.cctv8.co/eper-mall/api/file/uploadVideo

// 我关注的/我的动态列表
export const DynamicMyUrl = url1 + 'market/dynamic/list'
// 动态列表
export const DynamicListUrl = url1 + 'market/dynamic/indexList'
// 他人的动态
export const othersDynamicUrl = url1 + 'market/dynamic/othersDynamic'

// 喜欢动态
export const dynamicFavoriteUrl = url1 + 'market/dynamic/praiseList'

// 集市关联商品
export const marketmarketProductsUrl = url1 + 'market/marketProducts'


// 我发布的商品列表 
export const myProductsUrl = url1 + 'market/product/myProducts'
//  商品列表
export const productListUrl = url1 + 'market/product/list'

// 优品 我的
export function my(data) {
    return req3.request({
        url: 'userinfo/info',
        method: 'POST',
		data: data
    })
}


// 已预定的数量
export function countReserved(data) {
	return req3.request({
		url: 'market/order/countReserved',
		method: 'POST',
		data: data
	})
}

// 消息列表
export function messageList(data) {
	return req3.request({
		url: 'market/message/list',
		method: 'POST',
		data: data
	})
}

// 他人的信息
export function storeInfo(data) {
	return req1.request({
		url: 'market/user/storeInfo',
		method: 'POST',
		data: data
	})
}
// 我的信息
export function userInfo(data) {
	return req3.request({
		url: 'market/user/personal',
		method: 'POST',
		data: data
	})
}

//  粉丝列表
export function fansList(data) {
	return req3.request({
		url: 'market/follow/fansList',
		method: 'POST',
		data: data
	})
}

// 取消关注
export function followCancel(data) {
	return req3.request({
		url: 'market/follow/cancel',
		method: 'POST',
		data: data
	})
}
// 添加关注
export function followAdd(data) {
	return req3.request({
		url: 'market/follow/add',
		method: 'POST',
		data: data
	})
}
//  关注列表
export function followList(data) {
	return req3.request({
		url: 'market/follow/list',
		method: 'POST',
		data: data
	})
}
// 删除足迹
export function historyRemove(data) {
	return req3.request({
		url: 'market/history/remove',
		method: 'POST',
		data: data
	})
}
//  足迹列表
export function historyList(data) {
	return req3.request({
		url: 'market/history/list',
		method: 'POST',
		data: data
	})
}
//  收藏列表 
export function favoriteList(data) {
	return req3.request({
		url: 'market/productFavorite/list',
		method: 'POST',
		data: data
	})
}
//  取消 收藏 
export function favoriteCancel(data) {
	return req3.request({
		url: 'market/productFavorite/cancel',
		method: 'POST',
		data: data
	})
}

//  添加 收藏 
export function favoriteAdd(data) {
	return req3.request({
		url: 'market/productFavorite/add',
		method: 'POST',
		data: data
	})
}


// 购物车 修改
export function cartupdate(data) {
	return req3.request({
		url: 'market/cart/update',
		method: 'POST',
		data: data
	})
}
// 购物车 列表
export function cartList(data) {
	return req3.request({
		url: 'market/cart/list',
		method: 'POST',
		data: data
	})
}
// 购物车 删除
export function cartDelete(data) {
	return req3.request({
		url: 'market/cart/delete',
		method: 'POST',
		data: data
	})
}
// 购物车添加
export function cartAdd(data) {
	return req3.request({
		url: 'market/cart/add',
		method: 'POST',
		data: data
	})
}

// 商品列表 商品搜索 
export function productList(data) {
	return req1.request({
		url: 'market/product/list',
		method: 'POST',
		data: data
	})
}
// 商品x修改
export function productyUpdate(data) {
	return req3.request({
		url: 'market/product/update',
		method: 'POST',
		data: data
	})
}

// 商品删除
export function productyDelete(data) {
	return req3.request({
		url: 'market/product/delete',
		method: 'POST',
		data: data
	})
}

// 商品下架
export function productyShelf(data) {
	return req3.request({
		url: 'market/product/shelf',
		method: 'POST',
		data: data
	})
}

// 商品上架
export function productyShelves(data) {
	return req3.request({
		url: 'market/product/shelves',
		method: 'POST',
		data: data
	})
}

// 商品类别
export function categoryList(data) {
	return req1.request({
		url: 'market/category/list',
		method: 'GET',
		data: data
	})
}
// 商品 详情	
export function ProductsDetail(data) {
	return req1.request({
		url: 'market/product/detail',
		method: 'POST',
		data: data
	})
}
// 我发布的商品列表
export function myProducts(data) {
	return req3.request({
		url: 'market/product/myProducts',
		method: 'POST',
		data: data
	})
}
// 商品创建
export function productCreate(data) {
	return req3.request({
		url: 'market/product/create',
		method: 'POST',
		data: data
	})
}
// 动态 点赞
export function DynamicPraise(data) {
	return req3.request({
		url: 'market/dynamic/praise',
		method: 'POST',
		data: data
	})
}
// 取消点赞
export function DynamicCancelPraise(data) {
	return req3.request({
		url: 'market/dynamic/cancelPraise',
		method: 'POST',
		data: data
	})
}

// 动态我的列表/关注 
export function DynamicMy(data) {
	return req3.request({
		url: 'market/dynamic/list',
		method: 'POST',
		data: data
	})
}
// 动态列表 
export function DynamicList(data) {
	return req3.request({
		url: 'market/dynamic/indexList',
		method: 'POST',
		data: data
	})
}
// 动态详情
export function DynamicDetail(data) {
	return req1.request({
		url: 'market/dynamic/detail',
		method: 'POST',
		data: data
	})
}
// 动态删除
export function DynamicDelete(data) {
	return req3.request({
		url: 'market/dynamic/delete',
		method: 'POST',
		data: data
	})
}
// 动态修改
export function DynamicUpdate(data) {
	return req3.request({
		url: 'market/dynamic/update',
		method: 'POST',
		data: data
	})
}
// 动态创建
export function DynamicCreate(data) {
	return req3.request({
		url: 'market/dynamic/create',
		method: 'POST',
		data: data
	})
}

// 首页集市列表
export function indexMarkets(data) {
	return req1.request({
		url: 'market/indexMarkets',
		method: 'POST',
		data: data
	})
}
// 集市详情
export function MarketsDetail(data) {
	return req1.request({
		url: 'market/detail',
		method: 'POST',
		data: data
	})
}
// 集市关联商品
export function marketmarketProducts(data) {
	return req1.request({
		url: 'market/marketProducts',
		method: 'POST',
		data: data
	})
}
// 创建集市
export function createMarket(data) {
	return req3.request({
		url: 'market/create',
		method: 'POST',
		data: data
	})
}
// 修改集市
export function MarketUpdate(data) {
	return req3.request({
		url: 'market/update',
		method: 'POST',
		data: data
	})
}
// 我的集市列表
export function myMaketList(data) {
	return req3.request({
		url: 'market/myMarkets',
		method: 'POST',
		data: data
	})
}

// 添加地址
export function addressAdd(data) {
	return req3.request({
		url: 'market/address/add',
		method: 'POST',
		data: data
	})
}
// 删除地址
export function addressDelete(data) {
	return req3.request({
		url: 'market/address/delete',
		method: 'POST',
		data: data
	})
}
// 修改地址
export function addressupdate(data) {
	return req3.request({
		url: 'market/address/update',
		method: 'POST',
		data: data
	})
}
//  地址列表
export function addresslist(data) {
	return req3.request({
		url: 'market/address/list',
		method: 'POST',
		data: data
	})
}
//  默认地址
export function addressdefaultAddress(data) {
	return req3.request({
		url: 'market/address/defaultAddress',
		method: 'POST',
		data: data
	})
}

//  高德地图搜索
export function inputtips(data) {
	var url = "https://restapi.amap.com/v3/assistant/inputtips?parameters"
	data.key = "274b2ed365266aa21c054ea265162f9b"
	uni.request({
		url: url,
		method: 'POST',
		data: data,
	})
}
//  创建店铺
export function createStore(data) {
	return req3.request({
		url: 'market/store/create',
		method: 'POST',
		data: data
	})
}
//  修改店铺 
export function storeUpdate(data) {
	return req3.request({
		url: 'market/store/update',
		method: 'POST',
		data: data
	})
}
//  店铺类别
export function storeCategory(data) {
	return req1.request({
		url: 'market/store/category',
		method: 'POST',
		data: data
	})
}
// 个人店铺信息 
export function storePersonalStore(data) {
	return req3.request({
		url: 'market/store/personalStore',
		method: 'POST',
		data: data
	})
}
//  店铺详情
export function storeDetail(data) {
	return req1.request({
		url: 'market/store/detail',
		method: 'POST',
		data: data
	})
}
//  优惠活动
export function activityCreate(data) {
	return req3.request({
		url: 'market/activity/create',
		method: 'POST',
		data: data
	})
}
//  优惠活动 修改
export function activityUpdate(data) {
	return req3.request({
		url: 'market/activity/update',
		method: 'POST',
		data: data
	})
}
//  优惠活动 删除
export function activityDelete(data) {
	return req3.request({
		url: 'market/activity/delete',
		method: 'POST',
		data: data
	})
}
//  优惠活动列表
export function activityList(data) {
	return req1.request({
		url: 'market/activity/list',
		method: 'POST',
		data: data
	})
}
//  店铺内商品分类 创建
export function productCategory(data) {
	return req3.request({
		url: 'market/productCategory/create',
		method: 'POST',
		data: data
	})
}
//  店铺内商品分类 修改
export function productCategoryUpdate(data) {
	return req3.request({
		url: 'market/productCategory/update',
		method: 'POST',
		data: data
	})
}
//  店铺内商品分类 删除
export function productCategoryDelect(data) {
	return req3.request({
		url: 'market/productCategory/delete',
		method: 'POST',
		data: data
	})
}
//  店铺内商品分类 列表
export function productCategoryList(data) {
	return req1.request({
		url: 'market/productCategory/list',
		method: 'POST',
		data: data
	})
} 
//  店铺 列表
export function storeList(data) {
	return req1.request({
		url: 'market/store/list',
		method: 'POST',
		data: data
	})
} 
//  店铺获取商品列表
export function productProductList(data) {
	return req1.request({
		url: 'market/product/productList',
		method: 'POST',
		data: data
	})
} 
//  商品评价 
export function productCommentCreate (data) {
	return req3.request({
		url: 'market/productComment/create',
		method: 'POST',
		data: data
	})
} 
//  获取商品评论列表 
export function productCommentList(data) {
	return req1.request({
		url: 'market/productComment/list',
		method: 'POST',
		data: data
	})
}   
//  商家回复
export function productCommentListReply(data) {
	return req1.request({
		url: 'market/productComment/reply',
		method: 'POST',
		data: data
	})
}  
//  店铺内计算价格
export function storeCalculatePrice(data) {
	return req3.request({
		url: 'market/order/storeCalculatePrice',
		method: 'POST',
		data: data
	})
}  
//  店铺结算
export function orderStoreCheckout(data) {
	return req3.request({
		url: 'market/order/storeCheckout',
		method: 'POST',
		data: data
	})
}   
//订单结算
export function orderCheckout(data) {
	return req3.request({
		url: 'market/order/checkout',
		method: 'POST',
		data: data
	})
} 
// 店铺内购物车列表
export function cartListStoreList(data) {
	return req3.request({
		url: 'market/cart/storeList',
		method: 'POST',
		data: data
	})
}  
// 店铺添加收藏
export function storeFavoriteAdd(data) {
	return req3.request({
		url: 'market/storeFavorite/add',
		method: 'POST',
		data: data
	})
}  
// 店铺取消收藏
export function storeFavoriteCancel(data) {
	return req3.request({
		url: 'market/storeFavorite/cancel',
		method: 'POST',
		data: data
	})
}  
// 店铺收藏 列表
export function storeFavoriteList(data) {
	return req3.request({
		url: 'market/storeFavorite/list',
		method: 'POST',
		data: data
	})
}  
// 广告列表
export function adList(data) {
    return req1.request({
        url:'ad/list',
        method:'POST',
		data: data
    })
} 